package org.adorsys.aderp.cash.work.encashment;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.adorsys.aderp.cash.domain.CashRegItem;
import org.springframework.util.Assert;

public class EncashmentSession {
	private String id;
	private Date begin;
	private Date end;
	public static boolean IS_OPEN = true;
	private List<CashRegItem> cashRegItems;
	private String cashier;
	public EncashmentSession(String id, Date begin,String cashier) {
		super();
		this.id = id;
		this.begin = begin;
		this.cashier = cashier;
	}
	
	public void addCashRegItem(CashRegItem cashRegItem){
		Assert.notNull(cashRegItem, "The cash reg item might not be null");
		if(this.cashRegItems == null) this.cashRegItems = new ArrayList<CashRegItem>();
		this.cashRegItems.add(cashRegItem);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getBegin() {
		return begin;
	}

	public void setBegin(Date begin) {
		this.begin = begin;
	}

	public Date getEnd() {
		return end;
	}

	public void setEnd(Date end) {
		this.end = end;
	}

	public List<CashRegItem> getCashRegItems() {
		return cashRegItems;
	}

	public void setCashRegItems(List<CashRegItem> cashRegItems) {
		this.cashRegItems = cashRegItems;
	}

	public String getCashier() {
		return cashier;
	}

	public void setCashier(String cashier) {
		this.cashier = cashier;
	}

	@Override
	public String toString() {
		return "EncashmentSession [id=" + id + ", begin=" + begin + ", end="
				+ end + ", cashRegItems=" + cashRegItems + ", cashier="
				+ cashier + "]";
	}
	
	
	
}
